// 不断更新模块的内存检测
const cluster = require('cluster');
const http = require('http');
const numCPUs = require('os').cpus().length;

if (cluster.isMaster) {
    // Fork workers.
    for (var i = 0; i < numCPUs; i++) {
        cluster.fork();
    }

    cluster.on('exit', (worker, code, signal) => {
        console.log(`worker ${worker.process.pid} died`);
    });
} else {
    console.log(1);
    var aa = require("./a.js")
    setInterval(function () {
        // 重新加载c
        delete require.cache[require.resolve('./a.js')];
        var a = require('./a.js')
        console.log('tt');
    }, 50)
}